import time

from selenium.webdriver.common.by import By
from ykao.uizdh.Base.Base import Base
class Page(Base):
    url='https://www.baidu.com/index.html'
    dy1=(By.XPATH,'//*[@id="su"]')
    srk=(By.XPATH,'//*[@id="kw"]')
    dy2=(By.XPATH,'//*[@id="wrapper_wrapper"]')
    xyy=(By.XPATH,'//*[@id="page"]/div/a[2]/span')
    dy3=(By.XPATH,'//*[@id="container"]')
    def yx(self):
        self.get_url(url=self.url)
        self.sleep(3)
        a=self.text(self.dy1)
        # assert '百度' in a
        self.sleep(2)
        self.send_keys(self.srk,'软件测试自动化')
        self.sleep(2)
        self.click(self.dy1)
        self.sleep(5)
        b=self.text(self.dy2)
        assert '软件测试自动化' in b
        self.sleep(2)
        self.click(self.xyy)
        self.sleep(5)
        c=self.text(self.dy3)
        assert '软件测试自动化' in c
        self.sleep(5)
